
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<script type="text/javascript">
	$(document).ready(function() {
		$(function() {
			$('#previewrequest').click(function() {
				$("#content2").html("Generating preview");
				$('#event_type').attr('value', 'login_preview_event');
				//alert($('form').serialize());
				$.ajax({
					type : "POST",
					data : $('form').serialize(),
					cache : false,
					url : "preview.html",
					success : function(data) {
						$("#content2").html(data);
					}
				});
				return false;
			});

			$('#sendrequest').click(function() {
				$("#content1").html("Sending Request");
				$('#event_type').attr('value', 'login_req_event');
				alert($('form').serialize());
				$.ajax({
					type : "POST",
					data : $('form').serialize(),
					cache : false,
					url : "request.html",
					success : function(data) {
						$("#content1").html(data);
					}
				});
				return false;
			});

		});
	});
</script>
</head>
<div id="content">
	<div id="content1">Response</div>
	<div id="content2">Preview</div>
	<div id="content3">
		<p>Login Request</p><br>
		<s:form action="preview" name="login_request">
			<s:hidden id="event_type" name="event_type" value="" />
			<s:textfield label="Client Identifier " name="client_id"
				maxlength="15"></s:textfield>
			<s:textfield label="Password" name="password" maxlength="10"></s:textfield>
			<s:textfield label="New Password" name="new_password" maxlength="10"></s:textfield>
			<s:label value="Options" />
			<s:textfield label="Version" name="version" maxlength="10"
				required="true"></s:textfield>
			<s:textfield label="Language" name="language" maxlength="10"></s:textfield>
			<s:label value="Svc's" />
			<s:textarea label="objURI " name="obj_uri" cols="30" rows="5"></s:textarea>
			<s:textarea label="Extensions" name="extensions" cols="30" rows="5"></s:textarea>
			<s:textfield label="Client Transaction Id" name="client_trans_id"
				maxlength="10"></s:textfield>
		</s:form>
		<br>
		<br>
		<button id="previewrequest">Preview</button>
		<button id="sendrequest">Send Request</button>
	</div>
</div>